package general.creator;

import general.product.Product;

/**
 * @Author 幻忧
 * @Date 2020/12/13 20:14
 * @Version 1.0
 * @Description 具体工厂类
 */
public class ConcreteCreator extends Creator {
    @Override
    public <T extends Product> T createProduct(Class<T> c) {
        Product product = null;
        try {
            product = (Product) Class.forName(c.getName()).newInstance();
        } catch (Exception e) {
            //异常处理
        }
        return (T) product;
    }


}
